//#Author:bin
// -*- charset = utf-8 -*-
// @time:2022/8/24 15:49
// @Author:bfl91
// @file : api.js
// @Software:WebStorm
import axios from "axios";
import url from "../../url";
import { Toast } from 'vant';
const api=axios.create({
    baseURL:url,
    timeout:2000,
});

//请求头
api.interceptors.request.use(function (config) {
    return config;
}, function (error) {
    return Promise.reject(error);
});

// 响应头
api.interceptors.response.use(function (response) {
    return response;
}, function (error){

    Toast({
        message:'呃..服务器走丢了.',
    })
    return Promise.reject(error);
})


export default api;